﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MusicEvolution.Database
{
    public class DataFieldList : List<DataField>
    {

        public DataField this[string name]
        {
            get
            {
                
                foreach (DataField field in this)
                {
                    if (field.Name.ToLower() == name.ToLower())
                    {
                        return field;
                    }
                }
                throw new ArgumentException();
            }

            set
            {

                for (int i = 0; i < base.Count; i++)
                {
                    DataField field = base[i];
                    if (field.Name.ToLower() == name.ToLower())
                    {
                        base[i] = value;
                        return;
                    }
                }
                throw new ArgumentException();
            }
        }


    }
}
